<#if servicePackage!="">
package ${servicePackage};
</#if>

<#if daoPackage!="">
import ${daoPackage}.${className}Dao;
</#if>
<#if entityPackage!="">
import ${entityPackage}.${className};
</#if>
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;

/**
* Created by ${author} on ${date}.
*/
@Service
@Transactional
public class ${className}ServiceImpl implements ${className}Service {

  @Resource
  ${className}Dao ${classFieldName}Dao;

  @Override
  public ${className} findById(Object id) {
    return ${classFieldName}Dao.findById(id);
  }

  @Override
  public List<${className}> findAll() {
    return ${classFieldName}Dao.findAll();
  }

  @Override
  public void save(${className} entity) {
    ${classFieldName}Dao.save(entity);
  }

  @Override
  public ${className} update(${className} entity) {
    return ${classFieldName}Dao.update(entity);
  }

  @Override
  public void delete(${className} entity) {
    ${classFieldName}Dao.delete(entity);
  }

}
